feat(#104): Performance optimization and caching#130
Merged
ISTIFANUS-N merged 4 commits intorinafcode:mainfrom Feb 23, 2026
Merged
feat(#104): Performance optimization and caching#130ISTIFANUS-N merged 4 commits intorinafcode:mainfrom
ISTIFANUS-N merged 4 commits intorinafcode:mainfrom
Conversation
- Contract: backup manifests, scheduling, integrity verification, recovery records, RTO tiers, audit - Indexer: backup/recovery entities, event handlers, BackupService, /backup API, RTO metrics, audit trail - Windows: check-wasm.ps1 and README troubleshooting for linker/export ordinal
Contract: performance cache (CachedBridgeSummary, TTL, invalidation), bounded get_top_chains_by_volume_bounded, events, test_performance. Indexer: CacheModule + dashboard cache, SUM/COUNT/AVG queries, PerformanceModule (/health, /metrics), MetricsService, dashboard spec.
ISTIFANUS-N
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
Implements #104 – Develop Advanced Performance Optimization and Caching: intelligent caching, query optimization, performance monitoring, and regression testing in both the Soroban contract and the NestJS indexer.
Contract: Performance cache module stores a bridge summary (health score + top chains by volume) with 1-hour TTL; admin can invalidate cache; bounded chain iteration for gas; new events for cache compute/invalidate.
Indexer: In-memory cache (60s TTL) for dashboard analytics; dashboard aggregates use SQL SUM/COUNT/AVG instead of full-table loads;
GET /healthandGET /metricsfor load balancers and monitoring; MetricsService tracks cache hit rate and latency; dashboard tests include cache behavior and a 2s latency regression test.🔗 Related Issue(s)
🎯 Type of Change
📝 Changes Made
performance.rs:PerformanceManagerwithget_cached_summary,compute_and_cache_summary,get_or_compute_summary,invalidate_cache(admin);CachedBridgeSummarytype; storage keysPERF_CACHE,PERF_TS; eventsPerfMetricsComputedEvent,PerfCacheInvalidatedEvent.get_top_chains_by_volume_boundedinanalytics.rs(max 50 chains) for gas-bound cache; kept existingget_top_chains_by_volumefor backward compatibility.lib.rs; public API:get_cached_bridge_summary,compute_and_cache_bridge_summary,invalidate_performance_cache.contracts/teachlink/tests/test_performance.rs(registration + type tests).CacheModule(60s TTL, global) inAppModule;DashboardServicecachesgetCurrentAnalytics()with keydashboard:analytics;invalidateDashboardCache()for manual invalidation.SUM/COUNT/AVGin SQL (no full-tablefind()+ reduce).PerformanceModule:MetricsService(request count, cache hits/misses, last dashboard ms, uptime),PerformanceControllerwithGET /healthandGET /metrics.CACHE_MANAGERandMetricsServicemocks; cache-hit test; performance regression test (getCurrentAnalytics < 2s); fixedgeneratedBy/savetypes indashboard.service.ts.IMPLEMENTATION.md: new “Performance optimization and caching” section.🧪 Testing
✅ Pre-Merge Checklist (Required)
test_performance.rs; indexer:npx jest --testPathPattern="dashboard"passes (7 tests).cargo build(may require MSVC on Windows; CI runs on Linux).cargo build -p teachlink-contract --target wasm32-unknown-unknownor.\scripts\check-wasm.ps1on Windows.cargo fmt --all -- --checkcargo clippy📋 Test Results
🔍 Review Checklist
📝 Code Quality
🧪 Testing Requirements
📚 Documentation
🔒 Security
🏗️ Contract-Specific (if applicable)
💥 Breaking Changes
📊 Performance Impact
get_cached_bridge_summary.get_top_chains_by_volume_boundedcaps iteration; cache avoids recompute within TTL.🔒 Security Considerations
🚀 Deployment Notes
📋 Reviewer Checklist
🎯 Ready for Review: